SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 41854: Unable to use string timestamp literals with the SQL Native Client 10.0 driver

DetailsHotfixAboutRate It

The following error can occur when you set a timestamp using literal values in SAS/ACCESS® Interface to ODBC and you are using Microsoft SQL Server Native client:

[Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when
converting date and/or time from character string.

With the Microsoft SQL Server Native Driver, the datetime literal value is cast to a DATETIME2 with the following format:

        yyyy-mm-dd hh:mm:ss[.9999999]

This level of precision might be more than what is passed in the literal timestamp string. If this amount of precision is required, you can specify the DATETIME2 scale either in a LIBNAME statement or in a DATA statement, as shown in the following examples:

LIBNAME Statement

libname myconn odbc dsn=DSN-name user=user-id password=password datetime2=yes;

DATA Statement

data myconn.mydata (datetime2=yes);

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS/ACCESS Interface to ODBCWindows 7 Professional 32 bit9.21_M29.39.2 TS2M39.3 TS1M1
Windows 7 Enterprise x649.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2008 for x649.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows XP Professional9.21_M29.39.2 TS2M39.3 TS1M1
Windows 7 Enterprise 32 bit9.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 20089.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2003 for x649.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2003 Standard Edition9.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2003 Enterprise Edition9.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2003 Datacenter Edition9.21_M29.39.2 TS2M39.3 TS1M1
Microsoft® Windows® for x649.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows XP 64-bit Edition9.21_M29.39.2 TS2M39.3 TS1M1
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.21_M29.39.2 TS2M39.3 TS1M1
Windows 7 Professional x649.21_M29.39.2 TS2M39.3 TS1M1
Windows 7 Ultimate 32 bit9.21_M29.39.2 TS2M39.3 TS1M1
Windows 7 Ultimate x649.21_M29.39.2 TS2M39.3 TS1M1
Windows Vista9.21_M29.39.2 TS2M39.3 TS1M1
Windows Vista for x649.21_M29.39.2 TS2M39.3 TS1M1
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.